Skip to content

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Oct 19, 2025

These have been missed for a long time, so we've been using 6-year-old versions this whole time.

kkysen added a commit that referenced this pull request Oct 20, 2025
…for `syn v2.0.107` and `cargo`'s sparse registry

`c2rust-bitfields-derive` depends on `syn v2.0`.
Without a `Cargo.lock`, like in transpiled projects (as opposed to `c2rust` itself),
this will resolve to `syn v2.0.107`, which requires Rust 1.68,
but the generated `rust-toolchain.toml` uses Rust 1.65 (the same as our own nightly).
This is currently breaking CI for the `c2rust-instrument` tests,
and will also break CI for `c2rust-testsuite` once #1418 lands (a bug fix).

Furthermore, the old git-based registry fetching is extremely slow in CI,
so when #1227 lands and switches to stable, we also want Rust 1.70 for `cargo`'s sparse registry.
Due to stable crates now building on stable but testing their output on nightly,
it is very difficult to correctly cache.
Updating the nightly of their output to the earliest to have the sparse registry should fix this.

The combination of this, #1418, #1419, #1420, and #1421 has been tested to work on `libxml2`:

```sh
cargo build --release
(cd ../c2rust-testsuite/tests/libxml2/repo/ &&
    $OLDPWD/target/release/c2rust-refactor --cargo --rewrite-mode inplace --lib reorganize_definitions
)
kkysen added a commit that referenced this pull request Oct 20, 2025
…for `syn v2.0.107` and `cargo`'s sparse registry

`c2rust-bitfields-derive` depends on `syn v2.0`.
Without a `Cargo.lock`, like in transpiled projects (as opposed to `c2rust` itself),
this will resolve to `syn v2.0.107`, which requires Rust 1.68,
but the generated `rust-toolchain.toml` uses Rust 1.65 (the same as our own nightly).
This is currently breaking CI for the `c2rust-instrument` tests,
and will also break CI for `c2rust-testsuite` once #1418 lands (a bug fix).

Furthermore, the old git-based registry fetching is extremely slow in CI,
so when #1227 lands and switches to stable, we also want Rust 1.70 for `cargo`'s sparse registry.
Due to stable crates now building on stable but testing their output on nightly,
it is very difficult to correctly cache.
Updating the nightly of their output to the earliest to have the sparse registry should fix this.

The combination of this, #1418, #1419, #1420, and #1421 has been tested to work on `libxml2`:

```sh
cargo build --release
(cd ../c2rust-testsuite/tests/libxml2/repo/ &&
    $OLDPWD/target/release/c2rust-refactor --cargo --rewrite-mode inplace --lib reorganize_definitions
)
kkysen added a commit that referenced this pull request Oct 20, 2025
…for `syn v2.0.107` and `cargo`'s sparse registry

`c2rust-bitfields-derive` depends on `syn v2.0`.
Without a `Cargo.lock`, like in transpiled projects (as opposed to `c2rust` itself),
this will resolve to `syn v2.0.107`, which requires Rust 1.68,
but the generated `rust-toolchain.toml` uses Rust 1.65 (the same as our own nightly).
This is currently breaking CI for the `c2rust-instrument` tests,
and will also break CI for `c2rust-testsuite` once #1418 lands (a bug fix).

Furthermore, the old git-based registry fetching is extremely slow in CI,
so when #1227 lands and switches to stable, we also want Rust 1.70 for `cargo`'s sparse registry.
Due to stable crates now building on stable but testing their output on nightly,
it is very difficult to correctly cache.
Updating the nightly of their output to the earliest to have the sparse registry should fix this.

The combination of this, #1418, #1419, #1420, and #1421 has been tested to work on `libxml2`:

```sh
cargo build --release
(cd ../c2rust-testsuite/tests/libxml2/repo/ &&
    $OLDPWD/target/release/c2rust-refactor --cargo --rewrite-mode inplace --lib reorganize_definitions
)
```
@kkysen kkysen force-pushed the kkysen/update-deps-in-generated-Cargo.toml branch from ee9bf45 to 7f72a0f Compare October 20, 2025 21:27
@kkysen kkysen changed the base branch from master to kkysen/update-generated-rust-version October 20, 2025 21:27
match extern_crate {
ExternCrate::C2RustBitfields => Self::new("c2rust-bitfields", "0.3", true),
ExternCrate::C2RustAsmCasts => Self::new("c2rust-asm-casts", "0.2", true),
ExternCrate::C2RustBitfields => Self::new("c2rust-bitfields", "0.21", true),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get the version of the transpiler here, and make sure it always matches?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sure, I think we can do that, too. I'll add a commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants